<template>
	<sysJk :label="'8.火灾自动报警系统联动功能测试'" showBack :withoutTop="true" :leftTime="lefttime">
		<template v-slot:content>
			<view class="warp" id="warp" @touchmove.stop="()=>{}">
				<view class="w100" v-if="curnum==0">
					<view class="taskTit">
						{{questions[curnum]}}
					</view>
					<view class="imgview" :style="{height:'calc(100vh - '+tH+'px)'}">
						<image :src="bUrl" style="width:100%;height:100%;position:absolute;top:0;z-index: 0;"></image>
					</view>
					<view class="myCard" style="position: absolute;left:0;top:0;width:100%;height:100%">
						<view class="cardContent">
							<view class="answerview">
								<view class="ytitle"> 请判断所启动消防设备的启动状态</view>
								<view>通过联动触发信号，判断所启动的消防设备状态</view>
								<radio-group @change="aChange">
									<label ref="radiolist" class="ritem" v-for="item,index in answer1" :key="index">
										<view>
											<radio :value="item" :checked="da1 === item"
												:style="{transform:'scale('+heightBl+')'}" />{{item}}
										</view>
									</label>
								</radio-group>
							</view>
							<view>
								<view v-if="istool" class="toolbox">
									<view class="tc1">工具箱</view>
									<view class="toolitems">
										<view class="toolitem" :class="toolid==1?'bord':''" @click="seltool(1)">
											<view>
												<image class="toolimg" :src="tool1"></image>
											</view>
											<view class="tc">
												<view>感温探测器</view>
											</view>
										</view>
										<view class="toolitem" :class="toolid==2?'bord':''" @click="seltool(2)">
											<view>
												<image class="toolimg" :src="tool2"></image>
											</view>
											<view class="tc">感烟探测器</view>
										</view>
										<view class="toolitem" :class="toolid==3?'bord':''" @click="seltool(3)">
											<view>
												<image class="toolimg" :src="tool3"></image>
											</view>
											<view class="tc">
												<view>消防电话</view>
											</view>
										</view>
										<view class="toolitem" :class="toolid==5?'bord':''" @click="seltool(5)">
											<view>
												<image class="toolimg" :src="tool5"></image>
											</view>
											<view class="tc"> 照度计</view>
										</view>
										<view class="toolitem" :class="toolid==6?'bord':''" @click="seltool(6)">
											<view>
												<image class="toolimg" :src="tool6"></image>
											</view>
											<view class="tc">风速仪</view>
										</view>
										<view class="toolitem" :class="toolid==7?'bord':''" @click="seltool(7)">
											<view>
												<image class="toolimg" :src="tool7"></image>
											</view>
											<view class="tc">微压计</view>
										</view>
									</view>
									<view @click="toolclick()" class="toolbtn"> 确定</view>
								</view>
							</view>
							<view class="handleBtn">
								<u-button v-if="examType==1"
									:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'green',color:'#fff',fontSize:'3vh'}"
									@click='explain(0)'>查看解析</u-button>

							</view>
							<view class="btnA">
								<view v-if="isarea" class="areas">
									<view class="areasTit">场景选择</view>
									<view :class="curarea==0?'areaitem sitem':'areaitem'" @click="setarea(0)">
										<image class="aimg" :src="area1"></image>消防控制室
									</view>
									<view :class="curarea==1?'areaitem sitem':'areaitem'" @click="setarea(1)">
										<image class="aimg" :src="area2"></image>走廊
									</view>
								</view>
								<view class="btnArea "><u-button
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}"
										@click="senda1()">提交</u-button>
									<u-button @click="reset1()"
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}">重做</u-button>
									<u-button
										:custom-style="{width:'100rpx',height:'30rpx',borderRadius:'10rpx',marginRight:'10px',background:'#1E90FF',color:'#fff',fontSize:'3vh'}"
										@click="back()">返回</u-button>
								</view>
							</view>




							<view v-if="isa1area1" id="area11" class="openiv"
								:style="{ left:a1area11left,top:a1area11top}" @tap="openimgview('8-2',82)">
								<image class="openi" :src="openimg"></image>
							</view>
							<!-- 空放大
							<view v-if="isa1area1" id="area12" class="openiv"
								:style="{ left:a1area12left,top:a1area12top}" >
								<image class="openi" :src="openimg"></image>
							</view>
							-->

							<view v-if="isa1area2" id="area12" class="openiv"
								:style="{ left:a1area21left,top:a1area21top}" @tap="openimgview('8-4',84)">
								<image class="openi" :src="openimg"></image>
							</view>

							<!--82-->
							<view v-if="isa182" id="area820" class="openiv ds  "
								:style="{ left:a1i821left,top:a1i821top}">
								{{time}}
							</view>


							<view v-if="isa182" id="area821" class="openiv rem7"
								:style="{ left:a1i822left,top:a1i822top,color:'#000'}">
								<view class="flexcol">
									<view v-if="iscreen==0" :style="{ width:stw,height:sth,color:'#000'}"></view>
									<view v-if="iscreen==1" :style="{ width:stw,height:sth,color:'#fff'}">火警信息</view>
									<view v-if="iscreen==2" :style="{ width:stw,height:sth,color:'#fff'}">启动信息</view>
									<view v-if="iscreen==3" :style="{ width:stw,height:sth,color:'#fff'}">反馈信息</view>
									<view class="flexrow">
										<view v-if="iscreen==0"
											:style="{ width:siw,height:sbw,color:'#000',lineHeight:sbw,textAlign:'center'}">
											正常监控状态</view>
										<view v-if="iscreen==1" :style="{ width:siw,height:sbw,color:'#000'}">
											<view><text class="rtext">首警</text> {{stime1}} 1-1手报火警</view>
											<view>{{stime1}} 1-1感烟探测器火警</view>
										</view>
										<view v-if="iscreen==2" :style="{ width:siw,height:sbw,color:'#000'}"><text>
												{{info}}</text></view>
										<view v-if="iscreen==3" :style="{ width:siw,height:sbw,color:'#000'}"> <text>
												{{info}}</text></view>

										<view class="flexcol" :style="{marginLeft:sleft}">
											<view class="flexcol"
												:style="{ width:sbw,height:sbh,color:'#000',marginTop:'3px'}">
												<view style="line-height: 0.4rem;">
													正常运行
												</view>
												<view style="line-height: 0.4rem;">
													手动允许
												</view>
												<view style="line-height: 0.4rem;">
													自动允许
												</view>
											</view>
											<view
												:style="{marginTop:srtt, width:srtw,height:srth,color:'#fff',textAlign:'center'}"
												t80 w137 h30>
												<view style="line-height: 0.3rem;font-size: 0.3rem;">{{dfulltxt}}</view>
												<view style="line-height: 0.3rem;font-size: 0.3rem;">{{dtimetxt}}</view>
											</view>
										</view>
									</view>
									<view v-if="iscreen==0" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1查火警
										F2查启动 F3查故障 F4查监管 F5查屏蔽 F6查反馈
									</view>
									<view v-if="iscreen==1" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1查火警
										F2查启动 F3查故障 F4查监管 F5查屏蔽 F6查反馈
									</view>
									<view v-if="iscreen==2" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1页001 F2上一页 F3下一页
										F6退出
									</view>
									<view v-if="iscreen==3" style=" color:#000"
										:style="{ marginTop:sitt, width:s5w,height:s5h,color:'#fff'}">F1页001 F2上一页 F3下一页
										F6退出
									</view>
								</view>
							</view>



							<view v-if="iscreen!=0 && isa182" id="areaf12" class="openiv "
								:style="{ left:ficonl,top:ficont,width:sciconw,height:sciconh}">
								<image class="openi openiv"
									:style="{ left:ficonl,top:ficont,width:sciconw,height:sciconh}" :src="redbtn">
								</image>
							</view>
							<view v-if="iscreen!=0  && isa182" id="areaf22" class="openiv "
								:style="{ left:siconl,top:sicont,width:sciconw,height:sciconh}">
								<image class="openi openiv"
									:style="{ left:siconl,top:sicont,width:sciconw,height:sciconh}" :src="redbtn">
								</image>
							</view>
							<view v-if="iscreen!=0  && isf6status && isa182" id="areaf32" class="openiv "
								:style="{ left:iiconl,top:iicont,width:sciconw,height:sciconh}">
								<image class="openi openiv"
									:style="{ left:iiconl,top:iicont,width:sciconw,height:sciconh}" :src="redbtn">
								</image>
							</view>




							<view v-if="isa182" id="areaf2" class="openiv redbg"
								:style="{ left:f2left,top:f2top,width:f2w,height:f2h}" @tap="f2()">

							</view>

							<view v-if="isa182" id="areaf6" class="openiv redbg"
								:style="{ left:f6left,top:f6top,width:f6w,height:f6h}" @tap="f6()">
							</view>

							<view v-if="isa182" id="area821" class="openiv" :style="{ left:a1i823cleft,top:a1i822top}"
								@tap="openimgview('8-1',81)">
								<image class="openi" :src="closeimg"></image>
							</view>
							<!--openimgview('8-6',86)-->
							<view v-if="isa182" id="area822" class="openiv" :style="{ left:a1i823left,top:a1i823top}"
								@tap="showDialog">
								<image class="openi" :src="openimg"></image>
							</view>


							<!---86-->

							<view v-if="isa186" id="area861" class="openiv" :style="{ left:a1i862left,top:a1i862top}"
								@tap="openimgview('8-2',82)">
								<image class="openi" :src="closeimg"></image>
							</view>

							<view v-if="iscreen!=0 && isa186" id="area862" class="openiv infolist"
								:style="{ left:a1i861left,top:a1i861top,width:a1i861w}">

							</view>

							<u-mask :show="showFlag">
								<view class="wrapper"
									style="display: flex;align-items: center;justify-content: center;height:100%">
									<view class="block"
										style="width:200rpx;height:220rpx;background: #fff;color:#000;font-size: 1.5vh;">
										<view style="position: relative;height: 0;top: 0;right: -180rpx;">
											<image @click="onClickHide" class="openi" :src="closeimg"></image>
										</view>
										<view style="padding: 10rpx;" v-if="iscreen!=0">
											<view><text class="rtext">首警</text> {{stime1}} 1-1手报火警</view>
											<view>{{stime1}} 1-1感烟探测器火警</view>
											<view>{{stime1}} 排烟风机启动</view>
											<view>{{stime1}} 排烟口启动</view>
											<view>{{stime1}} 1-2压力开关监管报警</view>
											<view>{{stime1}} 1-2水流指示器监管报警</view>
											<view>{{stime1}} {{ isf6status?'排烟风机已反馈':'排烟风机未反馈'}} </view>
											<view>{{stime1}} {{ isf6status?'排烟口已反馈':'排烟口未反馈'}}</view>
										</view>
									</view>
								</view>
							</u-mask>

							<!--84-->

							<view v-if="isa184" id="area841" class="openiv" :style="{ left:a1i842left,top:a1i842top}"
								@tap="openimgview('8-3',83)">
								<image class="openi" :src="closeimg"></image>
							</view>

							<view v-if="isa184" id="area842" class="openiv  "
								:style="{ left:a1i841left,top:a1i841top,width:a1i841w,height:a1i841h}"
								@tap="playfire()">
							</view>


							<view v-if="isredbtn && isa184 " id="firered" class="openiv"
								:style="{ left:a184redleft,top:a184redtop,width:a184redw,height:a184redh}">
								<image class="openi openiv" :src="redbtn"
									:style="{ left:a184redleft,top:a184redtop,width:a184redw,height:a184redh}"></image>
							</view>



							<u-mask :show="isexplain" @click="closeex">
								<view class="wrapper"
									style="display: flex;align-items: center;justify-content: center;height:100%">
									<view class="block"
										style="width:400rpx;padding: 20rpx;box-sizing:border-box;background: #fff;font-size:2vh">
										<view class="overtitle" style="color: #000;">
											【试题解析】 正确答案
										</view>
										<view class="overtitle" style="color: #000;">
											<text>{{explaintext}}</text>
										</view>
									</view>
								</view>
							</u-mask>
						</view>
					</view>


				</view>

			</view>
		</template>
	</sysJk>

</template>


<script>
	import sysJk from '@/components/sysJk.vue'
	import {
		fzQuestion
	} from '@/globalApi/requestApi.js'
	import {
		formatTime,
		screentime,
		getcurtime
	} from '@/util/index.js'
	import {
		ref
	} from "vue"
	export default {
		components: {
			sysJk
		},

		data() {

			const app = getApp();
			const baseUrl = app.globalData.requestUrl;

			return {
				widthBl: 0,
				heightBl: 0,
				lefttime: '210',
				examId: '',
				examType: 1,
				num: 0,
				base: baseUrl,
				writeBox: null,
				writeBoxTop: 0,
				writeBoxLeft: 0,
				writeBox1Top: 0,
				writeBox1Left: 0,
				info: '正常监控状态',
				iscreen: 0, //屏状态  0 正常状态 1火警状态  2 f2 信息  f6退出  3，f6 查反馈  f6 退出   5复位 回到1
				stime1: '',
				dfulltxt: '',
				dtimetxt: '',

				stw: '479',
				sth: '28',
				sleft: "10",
				siw: '330',
				sih: '200',
				sbw: '146',
				sbh: "68",
				srtw: '138',
				srth: '30',
				srtt: '80',
				sitt: '15',
				s5w: "495",
				s5h: '25',

				isf6status: false, //默认反馈状态
				correct: '', //正确结果  


				areanum: 2, //场景数
				curarea: 0, //当前场景
				questionsnum: 1, //题目数
				openimg: baseUrl + "/static/image/open.png",
				closeimg: baseUrl + "/static/image/close.png",
				redbtn: baseUrl + "/static/image/red.png",
				greenimg: baseUrl + "/static/image/green.png", //
				curnum: 0, //当前题目
				time: '', //设置上显示时间
				time1: '',
				dtstr: '',


				questions: ['【1/1】请设置控制器控制方式，通过联动触发火警信号，启动相关消防设备', '【1/1】请设置控制器控制方式，通过联动触发火警信号，启动相关消防设备'],
				answer1: ['启动信号已发出设备未反馈', '启动信号已发出设备已反馈'],


				da1: "", //选项答案
				answer2: ['启动信号已发出设备未反馈', '启动信号已发出设备已反馈'],

				quest: {
					fz_id: 2,
					title: '火灾自动报警系统联动功能测试',
					no: "8",
					question_type: 1,
					user_answer: '',
					answer: '',
					is_correct: '', //1=答错 2=正确
					score: '', //得分
					start_time: 0, //开始时间
					end_time: 0, //结束时间
					question_answer: ''
				},
				showFlag: false,
				bUrl: baseUrl + "/static/image/wb/8-1.jpg",
				area1: baseUrl + "/static/image/wb/8-1.jpg",
				area2: baseUrl + "/static/image/wb/8-3.jpg",


				explainarr: [
					'联动触发火警信号，意思就是在主机自动允许的情况下，模拟火灾，看看主机能否自动联动设备，让设备启动。需要两点报火警才能联动成功，如探测器＋手报形成两点，或者两个探测器形成两点。先看主机是否自动允许，在去走廊按下手报触发报警，然后用工具祥探测器吹烟。最后回到主机F2查启动，F6查反馈。点打印机，选答案。\r\n\r\n正确答案:两种情况都可能出现看反馈状态'
				],
				istool: false,
				tool1: baseUrl + "/static/image/gw.png", //
				tool2: baseUrl + "/static/image/gy.png", //
				tool3: baseUrl + "/static/image/dh.png", //
				tool4: baseUrl + "/static/image/bs.png", //
				tool5: baseUrl + "/static/image/zm.png", //
				tool6: baseUrl + "/static/image/cf.png", //
				tool7: baseUrl + "/static/image/wyj.png", //
				tool8: baseUrl + "/static/image/cf.png", //

				isarea: true,
				isa1area1: true,
				isa1area2: false,
				a1area12left: 0,
				a1area12top: 0,
				a1area11left: 0,
				a1area11top: 0,


				a1area21left: 0,
				a1area21top: 0,

				//8-2
				isa182: false,

				a1i821left: 0,
				a1i821top: 0,

				a1i822left: 0,
				a1i822top: 0,

				a1i823left: 0,
				a1i823top: 0,

				a1i823cleft: 0,

				//f2
				//f2
				f2left: 1130,
				f2top: 549,
				f2w: 82,
				f2h: 45,

				//f6
				f6left: 1517,
				f6top: 549,
				f6w: 82,
				f6h: 45,


				//8-6
				isa186: false,
				a1i861left: 0,
				a1i861top: 0,

				a1i861w: 0,
				a1i862left: 0,
				a1i862top: 0,

				//84
				isa184: false,
				a1i841left: 0,
				a1i841top: 0,
				a1i841w: 0,
				a1i841h: 0,
				a1i842left: 0,
				a1i842top: 0,

				isredbtn: false,
				istoolck: false,
				a184redleft: 0,
				a184redtop: 0,
				a184redw: 17,
				a184redh: 17,

				toolid: 0,
				innerAudioContext: uni.createInnerAudioContext(),
				jb: baseUrl + "/static/image/jb.MP3",


				isexplain: false,
				explaintext: '',
				tH: 0,

				//屏图标宽高
				sciconw: 20,
				sciconh: 20,


				//自动方式
				aiconl: 430,
				aicont: 353,

				//手动方式
				miconl: 430,
				micont: 390,

				//火警
				ficonl: 649,
				ficont: 137,


				//启动
				siconl: 824,
				sicont: 139,

				//反馈
				iiconl: 824,
				iicont: 289,

				isf2: false,
				isf6: false,
				ispritn: false,

			}
		},
		onLoad(options) {
			uni.setScreenBrightness({
				keepScreenOn: true,
				direction: 'landscape',
				success() {
					console.log("a")
				}
			})

			this.examId = options.examId
			this.examType = options.examType

			let df = new Date()
			let m = df.getMonth() + 1
			this.dfulltxt = df.getFullYear() + "/" + m + "/" + df.getDate()
			let that = this
			setInterval(() => {
				let df1 = new Date()
				that.dtimetxt = df1.getHours() + ":" + df1.getMinutes() + ":" + df1.getSeconds()
			}, 1000)
			setInterval(() => {
				let df1 = new Date()
				that.time = getcurtime()
			}, 20000)

		},
		onShow() {
			let that = this;

			console.log(uni.getSystemInfoSync())
			let dt = new Date();
			let h = dt.getHours()
			let m = dt.getMinutes()
			this.time = getcurtime()
			let mo = dt.getMonth() + 1
			this.time1 = h + ":" + m + ":" + dt.getSeconds()
			this.dtstr = dt.getFullYear() + "/" + mo + "/" + dt.getDay()

		},
		onReady() {
			let that = this;
			// #ifdef MP-WEIXIN
			uni.getSystemInfo({
				success: function(res) {
					console.log(res)
					// uni.setStorageSync('titleHeight',res.statusBarHeight+capsuleH)
					that.tH = uni.getMenuButtonBoundingClientRect().height + uni
						.getMenuButtonBoundingClientRect().top * 2 + 21
					//that.tH=85
					that.drawWhiteBox()
				}
			});
			// #endif
			// #ifdef APP-PLUS
			let sy = uni.getSystemInfoSync()
			this.pT = sy.statusBarHeight
			this.tH = sy.statusBarHeight + 51
			that.drawWhiteBox(this.tH)
			// #endif

		},
		methods: {
			back() {
				uni.navigateBack()
			},

			//重做
			reset1() {
				this.isredbtn = false
				this.iscreen = 0
				this.toolid = 0
				this.istool = false
				this.istoolck = false

				this.innerAudioContext.stop()
				this.acurrent = -1
				this.iscreen = 0

				this.da1 = ""
				this.isf2 = false
				this.isf6 = false
				this.ispritn = false

				this.isa184 = false
				this.isa186 = false
				this.isa182 = false
				this.isa1area2 = false
				this.curarea = 0
				this.isarea = true
				this.isf6status = false
				this.setarea(0)
			},
			f2() {
				if (this.iscreen == 1) {
					this.isf2 = true
					this.iscreen = 2 //f2状态 
					this.info = this.stime1 + '排烟风机启动\r\n'
					this.info = this.info + this.stime1 + '排烟口启动'
				}
			},

			f6() {
				//f6状态
				if (this.iscreen == 2) { //	//退出
					this.iscreen = 1
				} else
				if (this.iscreen == 1) { //反馈
					this.isf6 = true
					this.iscreen = 3
					if (this.isf6status) {
						this.info = this.stime1 + '排烟风机已反馈\r\n'
						this.info = this.info + this.stime1 + '排烟口已反馈'
					} else {
						this.info = this.stime1 + '排烟风机未反馈\r\n'
						this.info = this.info + this.stime1 + '排烟口未反馈'
					}

				} else
				if (this.iscreen == 3) { //	//退出
					this.iscreen = 1
				}
			},

			seltool(id) {
				console.log("settool")
				this.toolid = id
			},
			toolclick() {
				//要提前下载一下8-5 8-5-1
				console.log("tool")
				//判断选择的工具
				console.log(this.toolid)
				if (this.toolid == 2) {
					this.istoolck = true
					if (this.isredbtn) {
						this.iscreen = 1
						//,随机状态
						this.isf6status = Math.random() > 0.5

					}
					//得分
					this.bUrl = this.base + "/static/image/wb/8-5.jpg"
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-5-1.jpg"
					}, 500)
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-5.jpg"
					}, 1500)
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-5-1.jpg"
					}, 2000)
					setTimeout(() => {
						this.bUrl = this.base + "/static/image/wb/8-3.jpg"
					}, 2500)
				}
			},
			explain(id) {
				this.isexplain = true;
				this.explaintext = this.explainarr[id]

			},
			closeex() {
				this.isexplain = false
			},

			playfire() {
				this.stime1 = screentime()
				this.isredbtn = true

				this.innerAudioContext.src = this.jb;
				this.innerAudioContext.onPlay(() => {
					console.log('开始播放');
				});
				this.innerAudioContext.onError((res) => {
					console.log(res.errMsg);
					console.log(res.errCode);
				});
				console.log(this.innerAudioContext.paused)
				if (this.innerAudioContext.paused == true) {
					console.log("play")
					this.innerAudioContext.play();
				} else {
					console.log("stop")
					this.innerAudioContext.stop();
				}
			},


			playjb() {

				// const innerAudioContext = uni.createInnerAudioContext();
				// innerAudioContext.autoplay = true;
				this.innerAudioContext.src = this.jb;
				this.innerAudioContext.onPlay(() => {
					console.log('开始播放');
				});
				this.innerAudioContext.onError((res) => {
					console.log(res.errMsg);
					console.log(res.errCode);
				});
				console.log(this.innerAudioContext.paused)
				if (this.innerAudioContext.paused == true) {

					console.log("play")

					this.innerAudioContext.play();
				} else {
					console.log("stop")
					this.innerAudioContext.stop();
				}

			},

			senda1() {
				

				// if(this.isf2 && this.isf6 && this.ispritn){
				// 	score=score+0.5
				// }

				let that = this
				
				that.$showModal2({
					title: '确认提交？'  
				}).then(() => {
					if (that.da1 == "") {
						uni.showToast({
							title: '请选择答案',
							icon: 'none'
						})
						return;
					}
					that.innerAudioContext.stop();
					
					let score = 0;
					if (that.istoolck && that.isredbtn) {
						//0.5触发两个  0.5分
						score = 0.5
					}
					if (that.isf6status && that.da1 == "启动信号已发出设备已反馈") {
						score = score + 2.5
					} else if (that.isf6status == false && that.da1 == "启动信号已发出设备未反馈") {
						score = score + 2.5
					} else {
						score = score + 0
					}
					that.quest = {
						fz_id: 2,
						title: '火灾自动报警系统联动功能测试',
						no: "8",
						question_type: 1,
						user_answer: '',
						answer: '',
						is_correct: '',
						score: score,
						start_time: 0,
						end_time: 0,
						question_answer: ''
					}
				 
					fzQuestion(that.quest).then(res => {
						console.log(res)
						uni.hideLoading()
						let pages = getCurrentPages()
						
						if(pages.length==4){
							let prevPage = pages[pages.length - 3] 
							prevPage.$vm.status8 = true
							prevPage.$vm.addScore(score)
							uni.navigateBack()
						}else{
							let prevPage = pages[pages.length - 2]
							prevPage.$vm.status8 = true
							prevPage.$vm.addScore(score) 
							uni.navigateBack()
						} 
					})

				});

				/***
				火灾自动报警系统联动功能测试【3分】
				【1/1】请设置控制器控制方式，通过联动触发火警信号，启动相关消防设备
				<请判断所启动消防设备的联动状态>
				通过联动触发信息，判断所启动的消防设备状态
				启动信号已发出设备未反馈
				启动信号已发出设备已反馈
				场景
				消防控制室，走廊   
				【有反馈和未反馈两种情况】
				
				【说明】三步.
				设置控制器自动允许   2分
				触发两个  0.5分
				查看控制室反馈情况  0.5分
				
				score1 :0,//2  设置控制器自动允许
				score2:0,//触发两个  0.5分
				op1:0,//两个操作点
				op2:0,
				score3:0,//查看控制室反馈情况0.5
				
				**/
			},
			//切换场景
			setarea(id) {
				this.curarea = id
				if (id == 0) {
					this.isa1area1 = true;
					this.isa1area2 = false;
					this.istool = false;
					this.bUrl = this.base + "/static/image/wb/8-1.jpg"
				}
				if (id == 1) {
					this.isa1area1 = false;
					this.isa1area2 = true;
					this.istool = true;
					this.bUrl = this.base + "/static/image/wb/8-3.jpg"
				}
			},
			aChange(e) {
				console.log(this.acurrent)
				this.da1 = e.detail.value
			},

			openimgview(path, lb) {
				this.isarea = false
				this.isa1area1 = false
				this.isa1area2 = false
				this.time = getcurtime()
				this.bUrl = this.base + "/static/image/wb/" + path + ".jpg";
				switch (lb) {
					case 81: //场1
						this.isa182 = false
						this.isa184 = false
						this.isarea = true
						this.isa1area1 = true;
						this.bUrl = this.base + "/static/image/wb/8-1.jpg"
						break;
					case 83:
						this.time = getcurtime()
						this.isa182 = false
						this.isa184 = false
						this.isa1area1 = false;
						this.isa1area2 = true
						this.istool = true
						this.isarea = true
						this.bUrl = this.base + "/static/image/wb/8-3.jpg"

						break;
					case 82:
						this.isa182 = true;
						this.isa186 = false;
						break;


					case 86:
						this.isa186 = true;
						this.isa182 = false;
						break;
					case 84:
						this.isa184 = true;
						this.istool = false;
						break;
				}
			},

			showDialog() {
				this.showFlag = true
				this.ispritn = true
			},
			onClickHide() {
				this.showFlag = false
			},


			drawWhiteBox(statusnum) {
				let that = this
				let warp = uni.createSelectorQuery().in(this).select('.imgview')
				warp.boundingClientRect(data => {
					console.log(that.tH)
					console.log(data)
					console.log(data.width)
					console.log(data.height)
					//有些设备取的是设备高度 data.height


					let widthBl = data.width / 1920
					let sy = uni.getSystemInfoSync()
					let heightBl = 0
					// if (data.height = sy.screenHeight) {
					// 	heightBl = (data.height - that.tH) / 921
					// } else {
					// 	heightBl = (data.height) / 921
					// }
					heightBl = (data.height - that.tH) / 921
					that.widthBl = widthBl
					that.heightBl = heightBl


					//8-1 
					that.a1area11left = 705 * widthBl + 'px'

					that.a1area11top = 500 * heightBl + statusnum + 'px'


					that.a1area12left = 885 * widthBl + 'px'
					that.a1area12top = 500 * heightBl + statusnum + 'px'

					that.writeBox1Left = 402 * widthBl + 'px'
					that.writeBox1Top = 107 * heightBl + statusnum + 'px'


					//8-2
					that.a1i821left = 430 * widthBl + 'px'
					that.a1i821top = 95 * heightBl + statusnum + 'px'

					that.a1i822left = 1130 * widthBl + 'px' //1130
					that.a1i822top = 96 * heightBl + statusnum + 'px' //96

					that.a1i823left = 765 * widthBl + 'px'
					that.a1i823top = 651 * heightBl + statusnum + 'px'

					that.a1i823cleft = 1750 * widthBl + 'px'


					//f2
					that.f2left = 1130 * widthBl + 'px'
					that.f2top = 471 * heightBl + statusnum + 'px'
					that.f2w = 82 * widthBl + 'px'
					that.f2h = 45 * heightBl + 'px'

					//f6
					that.f6left = 1517 * widthBl + 'px'
					that.f6top = 471 * heightBl + statusnum + 'px'
					that.f6w = 82 * widthBl + 'px'
					that.f6h = 45 * heightBl + 'px'



					//8-3
					that.a1area21left = 717 * widthBl + 'px'
					that.a1area21top = 508 * heightBl + statusnum + 'px'
					//8-5 


					//8-4 
					that.a1i841left = 985 * widthBl + 'px'
					that.a1i841top = 397 * heightBl + statusnum + 'px'
					that.a1i841w = 66 * widthBl + 'px'
					that.a1i841h = 56 * heightBl + 'px'



					that.a1i842left = 1250 * widthBl + 'px'
					that.a1i842top = 170 * heightBl + statusnum + 'px'


					//火警标志

					that.a184redleft = 983 * widthBl + 'px'
					that.a184redtop = 365 * heightBl + statusnum + 'px'
					that.a184redw = 17 * widthBl + 'px'
					that.a184redh = 17 * heightBl + 'px'



					//8-6
					that.a1i861left = 850 * widthBl + 'px'
					that.a1i861top = 119 * heightBl + statusnum + 'px'
					that.a1i861w = 350 * widthBl + 'px'
					that.a1i862left = 1300 * widthBl + 'px'
					that.a1i862top = 110 * heightBl + statusnum + 'px'


					//标题
					that.stw = 479 * widthBl + 'px'
					that.sth = 28 * heightBl + 'px'
					//中间两部分间隔
					that.sleft = 10 * widthBl + 'px'
					//内容
					that.siw = 340 * widthBl + 'px'
					that.sih = 200 * heightBl + 'px'
					//右边信息
					that.sbw = 146 * widthBl + 'px'
					that.sbh = 77 * heightBl + 'px'
					//右边时间
					that.srtw = 138 * widthBl + 'px'
					that.srth = 30 * heightBl + 'px'
					that.srtt = 90 * heightBl + 'px'
					//底部信息
					that.sitt = 0 * heightBl + 'px'
					that.s5w = 495 * widthBl + 'px'
					that.s5h = 25 * heightBl + 'px'


					//屏图标宽高
					that.sciconw = 20 * widthBl + 'px'
					that.sciconh = 20 * heightBl + 'px'


					//自动方式
					that.aiconl = 430 * widthBl + 'px'
					that.aicont = 353 * heightBl + statusnum + 'px'

					//手动方式
					that.miconl = 430 * widthBl + 'px'
					that.micont = 390 * heightBl + statusnum + 'px'

					//火警
					that.ficonl = 649 * widthBl + 'px'
					that.ficont = 137 * heightBl + statusnum + 'px'


					//启动
					that.siconl = 824 * widthBl + 'px'
					that.sicont = 139 * heightBl + statusnum + 'px'

					//反馈
					that.iiconl = 824 * widthBl + 'px'
					that.iicont = 289 * heightBl + statusnum + 'px'

				}).exec()

				// uni.getSystemInfo({
				// 	success: function(res) {
				// 		console.log(res)
				// 		

				// 	}
				// });
			},

		}
	}
</script>


<style scoped lang="scss">
	/* 在线链接服务仅供平台体验和调试使用，平台不承诺服务的稳定性，企业客户需下载字体包自行发布使用并做好备份。 */
	@font-face {
		font-family: "DS-Digital";
		font-weight: 400;
		src: url("//www.xfzsb.com/static/image/ds-digi.woff2") format("woff2"),


	}

	.red {
		background-color: #DA2627;
	}

	.rem7 {
		font-size: 0.4rem;
	}

	.warp {
		height: 100%;
		box-sizing: border-box;
		// padding: 22rpx 33rpx 38rpx 36rpx;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
		background: #F6F6F6;

		.explaincss {
			padding: 20rpx;
			width: 300rpx;

			border-radius: 20rpx;
			border: 1rpx solid #000;
			background-color: #fff;
			color: #000;
			position: fixed;
			top: 50rpx;
			left: 225rpx;
			z-index: 5000;
		}

		.flexcol {
			display: flex;
			flex-direction: column;
		}

		.flexrow {
			display: flex;
		}

		.ds {
			color: #DA2627;
			font-family: DS-Digital;
			font-size: 20px;
		}


		.w100 {
			width: 100%;
			height: 100%;
		}

		.openiv {
			position: fixed;
		}

		.redbg {}

		.infolist {
			color: #000;
			font-size: 0.4rem;

		}

		.rtext {
			color: red;
		}

		.openi {
			width: 20px;
			height: 20px;
		}

		.answerview {
			position: fixed;
			bottom: 45rpx;
			left: 40rpx;
			background-color: #ffffff;
			color: #000;
			width: 200rpx;
			font-size: 2vh;
		}

		.ytitle {
			background-color: #ffb700;
			line-height: 26rpx;
		}

		.ritem {
			line-height: 20rpx;
		}

		.imgview {
			position: relative;
			width: 100%;
		}

		.aimg {
			width: 60rpx;
			height: 35rpx;
		}

		.areas {
			// background-color: rgba(255, 165, 0, 0.2);
			margin-bottom: 10px;

			.areasTit {
				background: orange;
			}

			color: #000;
		}

		.sitem {
			border: 2rpx solid red;
		}

		.areaitem {
			background: #fff;

			display: flex;
			align-items: center;
			justify-content: flex-start;
		}

		.toolimg {
			width: 30rpx;
			height: 30rpx;
		}

		.toolbtn {
			font-size: 10px;
			padding: 5rpx 10rpx;
			background: #ffb700;
			border-radius: 5rpx;
			text-align: center;
			width: 50px;
			margin: auto;
		}

		.toolbox {
			position: fixed;
			right: 230rpx;
			bottom: 60rpx;
			font-size: 10rpx;
			color: #000;
			background: #fff;
			width: 92rpx;
			z-index: 10000;
			border: 1px solid #fff;
		}

		.bord {
			border: 1rpx solid red;
		}


		.toolitems {
			display: flex;
			flex-wrap: wrap;
			width: 92rpx;
			justify-content: space-between;
		}

		.toolitem {
			display: flex;
			flex-direction: column;
			width: 30rpx;
			justify-content: space-between;
		}

		.tc1 {
			text-align: center;
			font-size: 10px;
			background: orange;
			color: #fff;
		}

		.tc {
			display: flex;
			align-items: center;

			text-align: center;
			font-size: 8px;
			justify-content: center;
			align-content: center;
		}

		.taskTit {
			height: 21px;
			line-height: 21px;
			width: 100%;
			text-align: left;
			background: #fff;
			color: #000;
			font-size: 15px
		}

		.myCard {
			width: 100%;
			// height:100%;
			position: relative;
			// border-radius: 20rpx;
			//	overflow: hidden;
			z-index: 1;

			.cardContent {
				// padding: 52rpx 58rpx 37rpx;
				box-sizing: border-box;
				width: 100%;
				height: 100%;
				position: relative;
				z-index: 2;
				color: #fff;

				.moneyContent {
					margin-top: 54rpx;
					width: 100%;
					display: flex;
					align-items: center;

					.moneyDetail {
						width: 50%;
						display: flex;
						flex-direction: column;
						align-items: center;
						justify-content: flex-start;

						.detailTit {
							font-size: 24rpx;
							font-weight: 400;
						}

						.detailVal {
							font-size: 55rpx;
							font-weight: bold;
							margin-top: 35rpx;
						}
					}

				}



				.handleBtn {
					position: fixed;
					left: 30px;
					bottom: 0px;
				}

				.btnA {
					display: flex;
					flex-direction: column;
					position: fixed;
					right: 30px;
					bottom: 0px;
					align-items: flex-end;
				}

				.btnArea {
					//margin-top: 160rpx;
					//margin-left: 150rpx;
					display: flex;
					justify-content: center;
					// position:fixed;
					// right:30px;
					// bottom:30px
					// text-align: center;
				}
			}
		}

		.infoBox {
			width: 100%;
			padding: 14rpx 30rpx;
			margin-top: 33rpx;
			border-radius: 20rpx;
			box-sizing: border-box;
			background: #fff;

			.singleInfo {
				width: 100%;
				box-sizing: border-box;
				padding: 20rpx 0;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1rpx solid #ccc;

				.info {
					flex: 1;

					.desc {
						font-size: 26rpx;
						font-weight: 400;
						color: #222222;
					}

					.time {
						margin-top: 15rpx;
						font-size: 18rpx;
						font-weight: 400;
						color: #888888;
						display: flex;
						align-items: center;
					}
				}

				.val {
					width: 115rpx;
					height: 40rpx;
					border: 1rpx solid #DA2627;
					border-radius: 40rpx;
					text-align: center;
					font-size: 22rpx;
					font-weight: 400;
					color: #DA2627;
					line-height: 40rpx;
				}
			}
		}

		.writeBox {
			border: none;
			width: 0;
			height: 0;
			position: fixed
		}

		.boxtext {
			color: red;
			position: fixed;
		}
	}
</style>